<?php

namespace Gds\VenteBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Gds\VenteBundle\Entity\SessionCaisse
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Gds\VenteBundle\Entity\SessionCaisseRepository")
 */
class SessionCaisse {

    /**
     * @ORM\OneToMany(targetEntity="Gds\VenteBundle\Entity\TicketCaisse", mappedBy="session")
     */
    private $tickets; // Ici commentaires prend un "s", car un article a plusieurs commentaires !
    /**
     * @ORM\OneToMany(targetEntity="Gds\VenteBundle\Entity\ReglementClient", mappedBy="sessionCaisse")
     */
    private $reglements; // Ici commentaires prend un "s", car un article a plusieurs commentaires !
    /**
     * @ORM\ManyToOne(targetEntity="Gds\VenteBundle\Entity\Caisse", inversedBy="sessions")
     * @ORM\JoinColumn(nullable=false)
     */
    private $caisse;

    /**
     * @ORM\ManyToOne(targetEntity="Gds\UserBundle\Entity\User", inversedBy="sessions")
     * @ORM\JoinColumn(nullable=false)
     */
    private $user;

    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var \DateTime $date
     *
     * @ORM\Column(name="date", type="datetime")
     */
    private $date;

    /**
     * @var float $solde_initial
     *
     * @ORM\Column(name="solde_initial", type="decimal", scale=3)
     */
    private $solde_initial;

    /**
     * @var float $solde_final
     *
     * @ORM\Column(name="solde_final", type="decimal", scale=3, nullable=true)
     */
    private $solde_final;

    /**
     * @var float $ecart
     *
     * @ORM\Column(name="ecart", type="decimal", scale=3, nullable=true)
     */
    private $ecart;

    /**
     * @var \DateTime $date_fermeture
     *
     * @ORM\Column(name="date_fermeture", type="datetime", nullable=true)
     */
    private $date_fermeture;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId() {
        return $this->id;
    }

    /**
     * Set date
     *
     * @param \DateTime $date
     * @return SessionCaisse
     */
    public function setDate($date) {
        $this->date = $date;

        return $this;
    }

    /**
     * Get date
     *
     * @return \DateTime 
     */
    public function getDate() {
        return $this->date;
    }

    /**
     * Set solde_initial
     *
     * @param float $soldeInitial
     * @return SessionCaisse
     */
    public function setSoldeInitial($soldeInitial) {
        $this->solde_initial = $soldeInitial;

        return $this;
    }

    /**
     * Get solde_initial
     *
     * @return float 
     */
    public function getSoldeInitial() {
        return $this->solde_initial;
    }

    /**
     * Set solde_final
     *
     * @param float $soldeFinal
     * @return SessionCaisse
     */
    public function setSoldeFinal($soldeFinal) {
        $this->solde_final = $soldeFinal;

        return $this;
    }

    /**
     * Get solde_final
     *
     * @return float 
     */
    public function getSoldeFinal() {
        return $this->solde_final;
    }

    /**
     * Set ecart
     *
     * @param float $ecart
     * @return SessionCaisse
     */
    public function setEcart($ecart) {
        $this->ecart = $ecart;

        return $this;
    }

    /**
     * Get ecart
     *
     * @return float 
     */
    public function getEcart() {
        return $this->ecart;
    }

    /**
     * Set caisse
     *
     * @param Gds\VenteBundle\Entity\Caisse $caisse
     * @return SessionCaisse
     */
    public function setCaisse(\Gds\VenteBundle\Entity\Caisse $caisse) {
        $this->caisse = $caisse;

        return $this;
    }

    /**
     * Get caisse
     *
     * @return Gds\VenteBundle\Entity\Caisse 
     */
    public function getCaisse() {
        return $this->caisse;
    }

    /**
     * Constructor
     */
    public function __construct() {
        $this->tickets = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add tickets
     *
     * @param Gds\VenteBundle\Entity\TicketCaisse $tickets
     * @return SessionCaisse
     */
    public function addTicket(\Gds\VenteBundle\Entity\TicketCaisse $tickets) {
        $this->tickets[] = $tickets;

        return $this;
    }

    /**
     * Remove tickets
     *
     * @param Gds\VenteBundle\Entity\TicketCaisse $tickets
     */
    public function removeTicket(\Gds\VenteBundle\Entity\TicketCaisse $tickets) {
        $this->tickets->removeElement($tickets);
    }

    /**
     * Get tickets
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getTickets() {
        return $this->tickets;
    }

    /**
     * Set date_fermeture
     *
     * @param \DateTime $dateFermeture
     * @return SessionCaisse
     */
    public function setDateFermeture($dateFermeture) {
        $this->date_fermeture = $dateFermeture;

        return $this;
    }

    /**
     * Get date_fermeture
     *
     * @return \DateTime 
     */
    public function getDateFermeture() {
        return $this->date_fermeture;
    }

    /**
     * Set user
     *
     * @param \Gds\UserBundle\Entity\User $user
     * @return SessionCaisse
     */
    public function setUser(\Gds\UserBundle\Entity\User $user) {
        $this->user = $user;

        return $this;
    }

    /**
     * Get user
     *
     * @return \Gds\UserBundle\Entity\User 
     */
    public function getUser() {
        return $this->user;
    }


    /**
     * Add reglements
     *
     * @param \Gds\VenteBundle\Entity\ReglementClient $reglements
     * @return SessionCaisse
     */
    public function addReglement(\Gds\VenteBundle\Entity\ReglementClient $reglements)
    {
        $this->reglements[] = $reglements;

        return $this;
    }

    /**
     * Remove reglements
     *
     * @param \Gds\VenteBundle\Entity\ReglementClient $reglements
     */
    public function removeReglement(\Gds\VenteBundle\Entity\ReglementClient $reglements)
    {
        $this->reglements->removeElement($reglements);
    }

    /**
     * Get reglements
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getReglements()
    {
        return $this->reglements;
    }
}
